package com.chen.q4.router.impl;

import com.chen.q4.router.HttpEndpointRouter;

import java.util.List;
import java.util.Random;

public class RadomHttpEndpointRouter implements HttpEndpointRouter {

    @Override
    public String route(List<String> endpointList) {
        int size = endpointList.size();
        Random random = new Random(System.currentTimeMillis());
        return endpointList.get(random.nextInt(size)) ;
    }
}
